package com.dtsz.samples.redis.handler;

import com.dtsz.autoconfigure.framework.redis.annotation.RedisHandler;
import com.dtsz.autoconfigure.framework.redis.handler.IRedisMessageHandler;
import com.dtsz.samples.redis.constants.SamplesConstants;
import com.dtsz.samples.redis.model.Student;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@RedisHandler(topic = SamplesConstants.STUDENT_TOPIC_VALUE)
@Slf4j
public class StudentMessageHandler implements IRedisMessageHandler<Student> {
    @Override
    public void handle(Student student, String topic) {
        log.info("Handle redis message.topic=[{}], received=[{}]", topic, student);
    }
}
